package com.edu.fjnu.eshop.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.edu.fjnu.eshop.dao.OrderMapper;
import com.edu.fjnu.eshop.domain.Order;
import com.edu.fjnu.eshop.domain.OrderDetail;
@Service("OrderService")
public class OrderServiceImpl implements OrderService {

	@Autowired
	OrderMapper orderMapper;

	public void insertOrder(Order order) {
		orderMapper.insertOrder(order);
	}

	public void insertOrderDetail(OrderDetail orderDetail) {
		orderMapper.insertOrderDetail(orderDetail);
	}

	public void deletOrderAndDetail(int id) {
		orderMapper.deleteOrder(id);
		orderMapper.deleteOrderDetail(id);
	}

	public List<OrderDetail> findOrderDetail(int id) {
		return orderMapper.findOrderDetail(id);
	}

}
